package com.cjm.one.system.client;

import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.system.entity.SysResource;
import com.cjm.one.model.system.vo.SysResourceVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = ServerConstants.SERVER_ONE_SYSTEM)
public interface SysMenuClient {
    @PostMapping("/admin/system/menu/list")
    @Operation(summary = "查询菜单树状列表")
    Result<List<SysResourceVo>> list( @RequestBody  SysResource sysResource);

    @PutMapping("/admin/system/menu")
    @Operation(summary = "修改菜单")
    Result<Boolean> update( @RequestBody SysResource sysResource) ;
    @PostMapping("/admin/system/menu")
    @Operation(summary = "添加菜单")
    Result<Boolean> add( @RequestBody SysResource sysResource);

    @DeleteMapping("/admin/system/menu/{id}")
    @Operation(summary = "删除菜单")
    Result<Boolean> delete(@PathVariable("id") Long id);
    @GetMapping("/admin/system/menu/{id}")
    @Operation(summary = "根据id获取菜单")
    Result<SysResource> getById(@PathVariable("id") Long id);


}
